package com.wenwan.manage.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wenwan.manage.service.UserManagerService;

import javax.annotation.Resource;

/**
 * 用户-管理员
 * 
 * @author Admin
 *
 */
@Controller
@RequestMapping(value = "/user/manager")
public class UserManagerController {

	@Autowired
	private UserManagerService userManagerService;

	@ResponseBody
	@RequestMapping(value = "/create", method = { RequestMethod.POST })
	public Map<String,Object> create(@RequestParam(required = true) String userId) {
		return userManagerService.create(userId);
	}

	@ResponseBody
	@RequestMapping(value = "/delete/by/user/id", method = { RequestMethod.POST })
	public Map<String,Object> deleteByUserId(@RequestParam(required = true) String userId) {
		return userManagerService.deleteByUserId(userId);
	}

	@ResponseBody
	@RequestMapping(value = "/select/one/by/user/id", method = { RequestMethod.GET })
	public Map<String,Object> selectOneByUserId(@RequestParam(required = true) String userId) {
		return userManagerService.selectOneByUserId(userId);
	}

}
